BundleManager
@objc(LSBundleManager)
final class BundleManager : BaseManager
extension BundleManager : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Equatable, Hashable, NSObjectProtocol
Entry point to the LicenseSpring SDK Class for performing basic requests to LicenseSpring backend and managing license bundles
-
Initializes the BundleManager with the given configuration
Throws
LSErrorif configuration is invalidDeclaration
Swift
override init(configuration: Configuration) throwsParameters
configurationLicenseSpring configuration object
-
Activated Bundle or empty dictionary if no license is active.
Declaration
Swift
@objc var cachedLicenses: LicenseBundle -
Activate the bundle using license key.
Throws
Error if license activation fails. May be ofLSErrortype.Declaration
Swift
@objc func activateBundle(licenseKey: String) throws -> LicenseBundleParameters
licenseKeyLicense key for the product.
Return Value
Activated bundle.
-
Activate the license bundle using username and password.
Throws
Error if license activation fails. May be ofLSErrortype. @objcDeclaration
Swift
func activateBundle(username: String, password: String) throws -> LicenseBundleParameters
passwordUser’s password.
Return Value
Activated bundle.
-
Activate the license bundle using username and password.
Throws
Error if license activation fails. May be ofLSErrortype. @objcDeclaration
Swift
@objc func activateBundle(username: String, password: String, serverId: Int64) throws -> LicenseBundleParameters
passwordUser’s password.
Return Value
Activated bundle.
-
Activate the bundle using idToken
Throws
Error if license activation fails. May be ofLSErrortype.Declaration
Swift
@objc func activateBundle(idToken: String) throws -> LicenseBundleReturn Value
Activated bundle.
-
Activate the bundle using code
Throws
Error if license activation fails. May be ofLSErrortype.Declaration
Swift
@objc func activateBundle(code: String) throws -> LicenseBundleReturn Value
Activated bundle.
-
Deactivates the license bundle using licenseKey.
Declaration
Swift
@objc func deactivateBundle(licenseKey: String, removeLocalData: Bool = true) -> BoolParameters
licenseKeyLicense key for the product
removeLocalDataflag to remove local bundle data
Return Value
True if the deactivation is successfull
-
Deactivates the license bundle using username and password.
Declaration
Swift
@objc func deactivateBundle(username: String, password: String, removeLocalData: Bool = true) -> BoolParameters
passwordUser’s password.
removeLocalDataflag to remove local bundle data
Return Value
True if the deactivation is successfull
-
Deactivates the license bundle using idToken and customerAccountCode.
Declaration
Swift
@objc func deactivateBundle(idToken: String, customerAccountCode: String, removeLocalData: Bool = true) -> BoolParameters
idTokencustomerAccountCode.
removeLocalDataflag to remove local bundle data
Return Value
True if the deactivation is successfull
-
Deactivates the license bundle using code and customerAccountCode.
Declaration
Swift
@objc func deactivateBundle(code: String, customerAccountCode: String, removeLocalData: Bool = true) -> BoolParameters
codecustomerAccountCode.
removeLocalDataflag to remove local bundle data
Return Value
True if the deactivation is successfull
-
Check bundle for validity on the LicenseSpring platform.
Throws
Error if remote or local checks fail.Declaration
Swift
@objc func checkBundle(licenseKey: String) throws -> LicenseBundleParameters
licenseKeyLicense key for the product.
Return Value
Current bundle.
-
Check bundle for validity on the LicenseSpring platform.
Throws
Error if remote or local checks fail.Declaration
Swift
@objc func checkBundle(username: String) throws -> LicenseBundleParameters
usernameUser ID, typically email in lowercase.
Return Value
Current bundle.
-
Retrieve URL for Single Sign-On license activation.
Throws
Error if request fails. May be ofLSErrortype.Declaration
Swift
@objc func requestSSOURL() throws -> URLReturn Value
URL for Single Sign-On.
-
Activate the license using license activation response file.
Throws
Error if license activation fails. May be ofLSErrortype.Declaration
Swift
@objc func activateBundleOffline(_ activationResponseFile: URL) throws -> LicenseBundleParameters
activationResponseFileActivation response file location.
Return Value
Activated license bundle.
-
Creates offline activation file request.
Throws
Error if create activation file fails. May be ofLSErrortype.Declaration
Swift
@objc func createOfflineActivationFile(licenseKey: String, preferredLocation: URL? = nil) throws -> URLParameters
licenseKeyLicense key to be activated offline.
preferredLocationOptional custom activation request file location. ‘~/Desktop/ls_activation.req’ by default.
Return Value
Location of offline activation file request.
-
Creates offline activation file request.
Throws
Error if create activation file fails. May be ofLSErrortype.Declaration
Swift
@objc func createOfflineActivationFile(user: String, password: String, preferredLocation: URL? = nil, serverID: Int64 = 0) throws -> URLParameters
userUser ID, typically email in lowercase.
passwordUser’s password.
preferredLocationOptional custom activation request file location. ‘~/Desktop/ls_activation.req’ by default.
serverIDserverID, server-side license identifier, typically 64-bit id.
Return Value
Location of offline activation file request.
-
Creates the deactivate bundle offline request
Declaration
Swift
@objc func deactivateBundleOffline(licenseKey: String, serverID: Int64 = 0, preferredLocation: URL? = nil) throws -> URLParameters
licenseKeylicenseKey: License key to be activated offline.
-
Creates the deactivate bundle offline request
Declaration
Swift
@objc func deactivateBundleOffline(username: String, serverID: Int64 = 0, preferredLocation: URL? = nil) throws -> URLParameters
usernameUser ID, typically email in lowercase.
-
Returns current bundle of licenses (from memory or disk)
Declaration
Swift
func getCurrentBundle() throws -> LicenseBundleReturn Value
current License Bundle
-
Loads all licenses in a bundle from persistent storage
Declaration
Swift
func loadLicensesFromStorage() throws -> LicenseBundleReturn Value
current License Bundle
-
Undocumented
Declaration
Swift
func getCurrentLicense() -> License?